<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="user" class="entity.User" scope="session"/>
<jsp:useBean id="error" class="java.lang.String" scope="session"/>
<html>
	<head>
		<title>Recreation Manager - Izmena ličnih podataka</title>
		<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="theme.css" />
		<script type="text/javascript" src="scripts/linkfader.js"></script>
	</head>
	<c:if test="${user.userId==null}">
		<c:redirect url="./main.jsp" />
	</c:if>
	<body>
	<center>		
		<c:import url="./header.jsp"></c:import>
		<table class="mainTable">
			<tr>
				<td width="200px" valign="top">
					<c:import url="./menu.jsp"></c:import>
				</td>			
				<td valign="top">
					<form action="./EditProfile" name="formEditProfile" method="post" enctype="multipart/form-data" accept-charset="ISO-8859-1">
					<table class = "userChangeTable">
						<tr>
							<td colspan = "2"><h2 align="center">Izmena ličnih podataka</h2></td>
						</tr>
						<c:if test="${not empty error}">
							<c:choose>
								<c:when test="${error eq 'pwdErr'}">
								<tr>
									<td colspan = "2" align="center"><font color="red">Došlo je do greške prilikom proveravanje lozinke!</font></td>
								</tr>
								</c:when>
								<c:otherwise>
								<tr>
									<td colspan = "2" align="center"><font color="white">Promena podataka je uspešna</font></td>
								</tr>
								</c:otherwise>
							</c:choose>
							
						</c:if>
						<tr>
							<td align="right">Ime:</td>
							<td><input type="text" name="firstName" value="${user.firstName}"></td>
						</tr>
						<tr>
							<td align="right">Prezime:</td>
							<td><input type="text" name="lastName" value="${user.lastName}"></td>
						</tr>
						<tr>
							<td align="right">E-mail adresa:</td>
							<td><input type="text" name="email" value="${user.email}"></td>
						</tr>
						<tr>
							<td align="right">Broj telefona:</td>
							<td><input type="text" name="phone" value="${user.phone}"></td>
						</tr>
						<tr>
							<td align="right">Stara Lozinka:</td>
							<td><input type="password" name="passOld"></td>
						</tr>
						<tr>
							<td align="right">Nova lozinka:</td>
							<td><input type="password" name="passNew"></td>
						</tr>
						<tr>
							<td align="right">Nova lozinka ponovo:</td>
							<td><input type="password" name="passNew2"></td>
						</tr>
						<tr>
							<td align="right">Slika:</td>
							<td><input type="file" name="avatar"></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td><input type="submit" name="submit" value="Promena" ></td>
						</tr>
					</table>
					</form>
				</td>
			</tr>
		</table>
	</center>	
	</body>	
</html>